package zhao.lulu.service.impl;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;

import org.springframework.stereotype.Service;
import zhao.lulu.mapper.UserMapper;
import zhao.lulu.service.UserService;


import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Service("userService")
@Scope("singleton")
public class UserServiceImpl  implements UserService {
    @Autowired
    @Qualifier("userMapper")//按照id值从容器当中进行匹配
//    @Resource(name="userMapper")
    private UserMapper userDao;

    public void service() {

        userDao.findAll();
    }
   @PostConstruct
    public void init(){
        System.out.println("初始化方法");

    }
    @PreDestroy
    public void destroy(){
        System.out.println("要开始销毁了");

    }
}
